package com.googlecode.bestpaper;

// $ANTLR 3.2 Sep 23, 2009 12:02:23 /Users/alin/Documents/workspace/trunk/bestpaper/src/antlr/Bestpaper.g 2010-01-25 14:32:04

import org.antlr.runtime.*;
import java.util.Stack;
import java.util.List;
import java.util.ArrayList;

public class BestpaperLexer extends Lexer {
    public static final int LEVEL4=12;
    public static final int LEVEL5=13;
    public static final int LEVEL6=14;
    public static final int SECTION=7;
    public static final int ROW=15;
    public static final int CHAPTER_HEADING=6;
    public static final int BOOK=4;
    public static final int CHAPTER=5;
    public static final int TABLE_BORD=26;
    public static final int LEVEL1=9;
    public static final int EOF=-1;
    public static final int SPACE=17;
    public static final int LEVEL3=11;
    public static final int LEVEL2=10;
    public static final int WORD=25;
    public static final int NEWLINE=16;
    public static final int PARAGRAPH=8;
    public static final int H6=24;
    public static final int H5=23;
    public static final int CH=18;
    public static final int H4=22;
    public static final int H3=21;
    public static final int H2=20;
    public static final int H1=19;

    // delegates
    // delegators

    public BestpaperLexer() {;} 
    public BestpaperLexer(CharStream input) {
        this(input, new RecognizerSharedState());
    }
    public BestpaperLexer(CharStream input, RecognizerSharedState state) {
        super(input,state);

    }
    public String getGrammarFileName() { return "/Users/alin/Documents/workspace/trunk/bestpaper/src/antlr/Bestpaper.g"; }

    // $ANTLR start "TABLE_BORD"
    public final void mTABLE_BORD() throws RecognitionException {
        try {
            int _type = TABLE_BORD;
            int _channel = DEFAULT_TOKEN_CHANNEL;
            // /Users/alin/Documents/workspace/trunk/bestpaper/src/antlr/Bestpaper.g:60:2: ( '||' )
            // /Users/alin/Documents/workspace/trunk/bestpaper/src/antlr/Bestpaper.g:60:4: '||'
            {
            match("||"); 


            }

            state.type = _type;
            state.channel = _channel;
        }
        finally {
        }
    }
    // $ANTLR end "TABLE_BORD"

    // $ANTLR start "CH"
    public final void mCH() throws RecognitionException {
        try {
            int _type = CH;
            int _channel = DEFAULT_TOKEN_CHANNEL;
            // /Users/alin/Documents/workspace/trunk/bestpaper/src/antlr/Bestpaper.g:62:2: ( '-' )
            // /Users/alin/Documents/workspace/trunk/bestpaper/src/antlr/Bestpaper.g:62:4: '-'
            {
            match('-'); 

            }

            state.type = _type;
            state.channel = _channel;
        }
        finally {
        }
    }
    // $ANTLR end "CH"

    // $ANTLR start "H1"
    public final void mH1() throws RecognitionException {
        try {
            int _type = H1;
            int _channel = DEFAULT_TOKEN_CHANNEL;
            // /Users/alin/Documents/workspace/trunk/bestpaper/src/antlr/Bestpaper.g:64:5: ( '=' )
            // /Users/alin/Documents/workspace/trunk/bestpaper/src/antlr/Bestpaper.g:64:9: '='
            {
            match('='); 

            }

            state.type = _type;
            state.channel = _channel;
        }
        finally {
        }
    }
    // $ANTLR end "H1"

    // $ANTLR start "H2"
    public final void mH2() throws RecognitionException {
        try {
            int _type = H2;
            int _channel = DEFAULT_TOKEN_CHANNEL;
            // /Users/alin/Documents/workspace/trunk/bestpaper/src/antlr/Bestpaper.g:66:5: ( '==' )
            // /Users/alin/Documents/workspace/trunk/bestpaper/src/antlr/Bestpaper.g:66:9: '=='
            {
            match("=="); 


            }

            state.type = _type;
            state.channel = _channel;
        }
        finally {
        }
    }
    // $ANTLR end "H2"

    // $ANTLR start "H3"
    public final void mH3() throws RecognitionException {
        try {
            int _type = H3;
            int _channel = DEFAULT_TOKEN_CHANNEL;
            // /Users/alin/Documents/workspace/trunk/bestpaper/src/antlr/Bestpaper.g:68:5: ( '===' )
            // /Users/alin/Documents/workspace/trunk/bestpaper/src/antlr/Bestpaper.g:68:9: '==='
            {
            match("==="); 


            }

            state.type = _type;
            state.channel = _channel;
        }
        finally {
        }
    }
    // $ANTLR end "H3"

    // $ANTLR start "H4"
    public final void mH4() throws RecognitionException {
        try {
            int _type = H4;
            int _channel = DEFAULT_TOKEN_CHANNEL;
            // /Users/alin/Documents/workspace/trunk/bestpaper/src/antlr/Bestpaper.g:70:5: ( '====' )
            // /Users/alin/Documents/workspace/trunk/bestpaper/src/antlr/Bestpaper.g:70:9: '===='
            {
            match("===="); 


            }

            state.type = _type;
            state.channel = _channel;
        }
        finally {
        }
    }
    // $ANTLR end "H4"

    // $ANTLR start "H5"
    public final void mH5() throws RecognitionException {
        try {
            int _type = H5;
            int _channel = DEFAULT_TOKEN_CHANNEL;
            // /Users/alin/Documents/workspace/trunk/bestpaper/src/antlr/Bestpaper.g:72:5: ( '=====' )
            // /Users/alin/Documents/workspace/trunk/bestpaper/src/antlr/Bestpaper.g:72:9: '====='
            {
            match("====="); 


            }

            state.type = _type;
            state.channel = _channel;
        }
        finally {
        }
    }
    // $ANTLR end "H5"

    // $ANTLR start "H6"
    public final void mH6() throws RecognitionException {
        try {
            int _type = H6;
            int _channel = DEFAULT_TOKEN_CHANNEL;
            // /Users/alin/Documents/workspace/trunk/bestpaper/src/antlr/Bestpaper.g:74:5: ( '======' )
            // /Users/alin/Documents/workspace/trunk/bestpaper/src/antlr/Bestpaper.g:74:9: '======'
            {
            match("======"); 


            }

            state.type = _type;
            state.channel = _channel;
        }
        finally {
        }
    }
    // $ANTLR end "H6"

    // $ANTLR start "NEWLINE"
    public final void mNEWLINE() throws RecognitionException {
        try {
            int _type = NEWLINE;
            int _channel = DEFAULT_TOKEN_CHANNEL;
            // /Users/alin/Documents/workspace/trunk/bestpaper/src/antlr/Bestpaper.g:76:5: ( ( '\\r' )? '\\n' )
            // /Users/alin/Documents/workspace/trunk/bestpaper/src/antlr/Bestpaper.g:76:9: ( '\\r' )? '\\n'
            {
            // /Users/alin/Documents/workspace/trunk/bestpaper/src/antlr/Bestpaper.g:76:9: ( '\\r' )?
            int alt1=2;
            int LA1_0 = input.LA(1);

            if ( (LA1_0=='\r') ) {
                alt1=1;
            }
            switch (alt1) {
                case 1 :
                    // /Users/alin/Documents/workspace/trunk/bestpaper/src/antlr/Bestpaper.g:76:9: '\\r'
                    {
                    match('\r'); 

                    }
                    break;

            }

            match('\n'); 

            }

            state.type = _type;
            state.channel = _channel;
        }
        finally {
        }
    }
    // $ANTLR end "NEWLINE"

    // $ANTLR start "SPACE"
    public final void mSPACE() throws RecognitionException {
        try {
            int _type = SPACE;
            int _channel = DEFAULT_TOKEN_CHANNEL;
            // /Users/alin/Documents/workspace/trunk/bestpaper/src/antlr/Bestpaper.g:78:5: ( ( ' ' | '\\t' )+ )
            // /Users/alin/Documents/workspace/trunk/bestpaper/src/antlr/Bestpaper.g:78:9: ( ' ' | '\\t' )+
            {
            // /Users/alin/Documents/workspace/trunk/bestpaper/src/antlr/Bestpaper.g:78:9: ( ' ' | '\\t' )+
            int cnt2=0;
            loop2:
            do {
                int alt2=2;
                int LA2_0 = input.LA(1);

                if ( (LA2_0=='\t'||LA2_0==' ') ) {
                    alt2=1;
                }


                switch (alt2) {
            	case 1 :
            	    // /Users/alin/Documents/workspace/trunk/bestpaper/src/antlr/Bestpaper.g:
            	    {
            	    if ( input.LA(1)=='\t'||input.LA(1)==' ' ) {
            	        input.consume();

            	    }
            	    else {
            	        MismatchedSetException mse = new MismatchedSetException(null,input);
            	        recover(mse);
            	        throw mse;}


            	    }
            	    break;

            	default :
            	    if ( cnt2 >= 1 ) break loop2;
                        EarlyExitException eee =
                            new EarlyExitException(2, input);
                        throw eee;
                }
                cnt2++;
            } while (true);


            }

            state.type = _type;
            state.channel = _channel;
        }
        finally {
        }
    }
    // $ANTLR end "SPACE"

    // $ANTLR start "WORD"
    public final void mWORD() throws RecognitionException {
        try {
            int _type = WORD;
            int _channel = DEFAULT_TOKEN_CHANNEL;
            // /Users/alin/Documents/workspace/trunk/bestpaper/src/antlr/Bestpaper.g:80:5: ( (~ ( '\\r' | '\\n' | ' ' | '\\t' ) )+ )
            // /Users/alin/Documents/workspace/trunk/bestpaper/src/antlr/Bestpaper.g:80:9: (~ ( '\\r' | '\\n' | ' ' | '\\t' ) )+
            {
            // /Users/alin/Documents/workspace/trunk/bestpaper/src/antlr/Bestpaper.g:80:9: (~ ( '\\r' | '\\n' | ' ' | '\\t' ) )+
            int cnt3=0;
            loop3:
            do {
                int alt3=2;
                int LA3_0 = input.LA(1);

                if ( ((LA3_0>='\u0000' && LA3_0<='\b')||(LA3_0>='\u000B' && LA3_0<='\f')||(LA3_0>='\u000E' && LA3_0<='\u001F')||(LA3_0>='!' && LA3_0<='\uFFFF')) ) {
                    alt3=1;
                }


                switch (alt3) {
            	case 1 :
            	    // /Users/alin/Documents/workspace/trunk/bestpaper/src/antlr/Bestpaper.g:80:10: ~ ( '\\r' | '\\n' | ' ' | '\\t' )
            	    {
            	    if ( (input.LA(1)>='\u0000' && input.LA(1)<='\b')||(input.LA(1)>='\u000B' && input.LA(1)<='\f')||(input.LA(1)>='\u000E' && input.LA(1)<='\u001F')||(input.LA(1)>='!' && input.LA(1)<='\uFFFF') ) {
            	        input.consume();

            	    }
            	    else {
            	        MismatchedSetException mse = new MismatchedSetException(null,input);
            	        recover(mse);
            	        throw mse;}


            	    }
            	    break;

            	default :
            	    if ( cnt3 >= 1 ) break loop3;
                        EarlyExitException eee =
                            new EarlyExitException(3, input);
                        throw eee;
                }
                cnt3++;
            } while (true);


            }

            state.type = _type;
            state.channel = _channel;
        }
        finally {
        }
    }
    // $ANTLR end "WORD"

    public void mTokens() throws RecognitionException {
        // /Users/alin/Documents/workspace/trunk/bestpaper/src/antlr/Bestpaper.g:1:8: ( TABLE_BORD | CH | H1 | H2 | H3 | H4 | H5 | H6 | NEWLINE | SPACE | WORD )
        int alt4=11;
        alt4 = dfa4.predict(input);
        switch (alt4) {
            case 1 :
                // /Users/alin/Documents/workspace/trunk/bestpaper/src/antlr/Bestpaper.g:1:10: TABLE_BORD
                {
                mTABLE_BORD(); 

                }
                break;
            case 2 :
                // /Users/alin/Documents/workspace/trunk/bestpaper/src/antlr/Bestpaper.g:1:21: CH
                {
                mCH(); 

                }
                break;
            case 3 :
                // /Users/alin/Documents/workspace/trunk/bestpaper/src/antlr/Bestpaper.g:1:24: H1
                {
                mH1(); 

                }
                break;
            case 4 :
                // /Users/alin/Documents/workspace/trunk/bestpaper/src/antlr/Bestpaper.g:1:27: H2
                {
                mH2(); 

                }
                break;
            case 5 :
                // /Users/alin/Documents/workspace/trunk/bestpaper/src/antlr/Bestpaper.g:1:30: H3
                {
                mH3(); 

                }
                break;
            case 6 :
                // /Users/alin/Documents/workspace/trunk/bestpaper/src/antlr/Bestpaper.g:1:33: H4
                {
                mH4(); 

                }
                break;
            case 7 :
                // /Users/alin/Documents/workspace/trunk/bestpaper/src/antlr/Bestpaper.g:1:36: H5
                {
                mH5(); 

                }
                break;
            case 8 :
                // /Users/alin/Documents/workspace/trunk/bestpaper/src/antlr/Bestpaper.g:1:39: H6
                {
                mH6(); 

                }
                break;
            case 9 :
                // /Users/alin/Documents/workspace/trunk/bestpaper/src/antlr/Bestpaper.g:1:42: NEWLINE
                {
                mNEWLINE(); 

                }
                break;
            case 10 :
                // /Users/alin/Documents/workspace/trunk/bestpaper/src/antlr/Bestpaper.g:1:50: SPACE
                {
                mSPACE(); 

                }
                break;
            case 11 :
                // /Users/alin/Documents/workspace/trunk/bestpaper/src/antlr/Bestpaper.g:1:56: WORD
                {
                mWORD(); 

                }
                break;

        }

    }


    protected DFA4 dfa4 = new DFA4(this);
    static final String DFA4_eotS =
        "\1\uffff\1\6\1\10\1\12\3\uffff\1\13\1\uffff\1\15\2\uffff\1\17\1"+
        "\uffff\1\21\1\uffff\1\23\1\uffff\1\24\2\uffff";
    static final String DFA4_eofS =
        "\25\uffff";
    static final String DFA4_minS =
        "\1\0\1\174\2\0\3\uffff\1\0\1\uffff\1\0\2\uffff\1\0\1\uffff\1\0\1"+
        "\uffff\1\0\1\uffff\1\0\2\uffff";
    static final String DFA4_maxS =
        "\1\uffff\1\174\2\uffff\3\uffff\1\uffff\1\uffff\1\uffff\2\uffff\1"+
        "\uffff\1\uffff\1\uffff\1\uffff\1\uffff\1\uffff\1\uffff\2\uffff";
    static final String DFA4_acceptS =
        "\4\uffff\1\11\1\12\1\13\1\uffff\1\2\1\uffff\1\3\1\1\1\uffff\1\4"+
        "\1\uffff\1\5\1\uffff\1\6\1\uffff\1\7\1\10";
    static final String DFA4_specialS =
        "\1\2\1\uffff\1\6\1\4\3\uffff\1\1\1\uffff\1\10\2\uffff\1\0\1\uffff"+
        "\1\5\1\uffff\1\7\1\uffff\1\3\2\uffff}>";
    static final String[] DFA4_transitionS = {
            "\11\6\1\5\1\4\2\6\1\4\22\6\1\5\14\6\1\2\17\6\1\3\76\6\1\1\uff83"+
            "\6",
            "\1\7",
            "\11\6\2\uffff\2\6\1\uffff\22\6\1\uffff\uffdf\6",
            "\11\6\2\uffff\2\6\1\uffff\22\6\1\uffff\34\6\1\11\uffc2\6",
            "",
            "",
            "",
            "\11\6\2\uffff\2\6\1\uffff\22\6\1\uffff\uffdf\6",
            "",
            "\11\6\2\uffff\2\6\1\uffff\22\6\1\uffff\34\6\1\14\uffc2\6",
            "",
            "",
            "\11\6\2\uffff\2\6\1\uffff\22\6\1\uffff\34\6\1\16\uffc2\6",
            "",
            "\11\6\2\uffff\2\6\1\uffff\22\6\1\uffff\34\6\1\20\uffc2\6",
            "",
            "\11\6\2\uffff\2\6\1\uffff\22\6\1\uffff\34\6\1\22\uffc2\6",
            "",
            "\11\6\2\uffff\2\6\1\uffff\22\6\1\uffff\uffdf\6",
            "",
            ""
    };

    static final short[] DFA4_eot = DFA.unpackEncodedString(DFA4_eotS);
    static final short[] DFA4_eof = DFA.unpackEncodedString(DFA4_eofS);
    static final char[] DFA4_min = DFA.unpackEncodedStringToUnsignedChars(DFA4_minS);
    static final char[] DFA4_max = DFA.unpackEncodedStringToUnsignedChars(DFA4_maxS);
    static final short[] DFA4_accept = DFA.unpackEncodedString(DFA4_acceptS);
    static final short[] DFA4_special = DFA.unpackEncodedString(DFA4_specialS);
    static final short[][] DFA4_transition;

    static {
        int numStates = DFA4_transitionS.length;
        DFA4_transition = new short[numStates][];
        for (int i=0; i<numStates; i++) {
            DFA4_transition[i] = DFA.unpackEncodedString(DFA4_transitionS[i]);
        }
    }

    class DFA4 extends DFA {

        public DFA4(BaseRecognizer recognizer) {
            this.recognizer = recognizer;
            this.decisionNumber = 4;
            this.eot = DFA4_eot;
            this.eof = DFA4_eof;
            this.min = DFA4_min;
            this.max = DFA4_max;
            this.accept = DFA4_accept;
            this.special = DFA4_special;
            this.transition = DFA4_transition;
        }
        public String getDescription() {
            return "1:1: Tokens : ( TABLE_BORD | CH | H1 | H2 | H3 | H4 | H5 | H6 | NEWLINE | SPACE | WORD );";
        }
        public int specialStateTransition(int s, IntStream _input) throws NoViableAltException {
            IntStream input = _input;
        	int _s = s;
            switch ( s ) {
                    case 0 : 
                        int LA4_12 = input.LA(1);

                        s = -1;
                        if ( (LA4_12=='=') ) {s = 14;}

                        else if ( ((LA4_12>='\u0000' && LA4_12<='\b')||(LA4_12>='\u000B' && LA4_12<='\f')||(LA4_12>='\u000E' && LA4_12<='\u001F')||(LA4_12>='!' && LA4_12<='<')||(LA4_12>='>' && LA4_12<='\uFFFF')) ) {s = 6;}

                        else s = 15;

                        if ( s>=0 ) return s;
                        break;
                    case 1 : 
                        int LA4_7 = input.LA(1);

                        s = -1;
                        if ( ((LA4_7>='\u0000' && LA4_7<='\b')||(LA4_7>='\u000B' && LA4_7<='\f')||(LA4_7>='\u000E' && LA4_7<='\u001F')||(LA4_7>='!' && LA4_7<='\uFFFF')) ) {s = 6;}

                        else s = 11;

                        if ( s>=0 ) return s;
                        break;
                    case 2 : 
                        int LA4_0 = input.LA(1);

                        s = -1;
                        if ( (LA4_0=='|') ) {s = 1;}

                        else if ( (LA4_0=='-') ) {s = 2;}

                        else if ( (LA4_0=='=') ) {s = 3;}

                        else if ( (LA4_0=='\n'||LA4_0=='\r') ) {s = 4;}

                        else if ( (LA4_0=='\t'||LA4_0==' ') ) {s = 5;}

                        else if ( ((LA4_0>='\u0000' && LA4_0<='\b')||(LA4_0>='\u000B' && LA4_0<='\f')||(LA4_0>='\u000E' && LA4_0<='\u001F')||(LA4_0>='!' && LA4_0<=',')||(LA4_0>='.' && LA4_0<='<')||(LA4_0>='>' && LA4_0<='{')||(LA4_0>='}' && LA4_0<='\uFFFF')) ) {s = 6;}

                        if ( s>=0 ) return s;
                        break;
                    case 3 : 
                        int LA4_18 = input.LA(1);

                        s = -1;
                        if ( ((LA4_18>='\u0000' && LA4_18<='\b')||(LA4_18>='\u000B' && LA4_18<='\f')||(LA4_18>='\u000E' && LA4_18<='\u001F')||(LA4_18>='!' && LA4_18<='\uFFFF')) ) {s = 6;}

                        else s = 20;

                        if ( s>=0 ) return s;
                        break;
                    case 4 : 
                        int LA4_3 = input.LA(1);

                        s = -1;
                        if ( (LA4_3=='=') ) {s = 9;}

                        else if ( ((LA4_3>='\u0000' && LA4_3<='\b')||(LA4_3>='\u000B' && LA4_3<='\f')||(LA4_3>='\u000E' && LA4_3<='\u001F')||(LA4_3>='!' && LA4_3<='<')||(LA4_3>='>' && LA4_3<='\uFFFF')) ) {s = 6;}

                        else s = 10;

                        if ( s>=0 ) return s;
                        break;
                    case 5 : 
                        int LA4_14 = input.LA(1);

                        s = -1;
                        if ( (LA4_14=='=') ) {s = 16;}

                        else if ( ((LA4_14>='\u0000' && LA4_14<='\b')||(LA4_14>='\u000B' && LA4_14<='\f')||(LA4_14>='\u000E' && LA4_14<='\u001F')||(LA4_14>='!' && LA4_14<='<')||(LA4_14>='>' && LA4_14<='\uFFFF')) ) {s = 6;}

                        else s = 17;

                        if ( s>=0 ) return s;
                        break;
                    case 6 : 
                        int LA4_2 = input.LA(1);

                        s = -1;
                        if ( ((LA4_2>='\u0000' && LA4_2<='\b')||(LA4_2>='\u000B' && LA4_2<='\f')||(LA4_2>='\u000E' && LA4_2<='\u001F')||(LA4_2>='!' && LA4_2<='\uFFFF')) ) {s = 6;}

                        else s = 8;

                        if ( s>=0 ) return s;
                        break;
                    case 7 : 
                        int LA4_16 = input.LA(1);

                        s = -1;
                        if ( (LA4_16=='=') ) {s = 18;}

                        else if ( ((LA4_16>='\u0000' && LA4_16<='\b')||(LA4_16>='\u000B' && LA4_16<='\f')||(LA4_16>='\u000E' && LA4_16<='\u001F')||(LA4_16>='!' && LA4_16<='<')||(LA4_16>='>' && LA4_16<='\uFFFF')) ) {s = 6;}

                        else s = 19;

                        if ( s>=0 ) return s;
                        break;
                    case 8 : 
                        int LA4_9 = input.LA(1);

                        s = -1;
                        if ( (LA4_9=='=') ) {s = 12;}

                        else if ( ((LA4_9>='\u0000' && LA4_9<='\b')||(LA4_9>='\u000B' && LA4_9<='\f')||(LA4_9>='\u000E' && LA4_9<='\u001F')||(LA4_9>='!' && LA4_9<='<')||(LA4_9>='>' && LA4_9<='\uFFFF')) ) {s = 6;}

                        else s = 13;

                        if ( s>=0 ) return s;
                        break;
            }
            NoViableAltException nvae =
                new NoViableAltException(getDescription(), 4, _s, input);
            error(nvae);
            throw nvae;
        }
    }
 

}